<template>
	<view class="content">
		<!-- 列表 -->
		<view class="content-hender">
			<view @click="godetail(item.id)" class="content-list" v-for="item in list" :key='item.id'>
				<view class="list-header">
					<view class="left">
						<view><image class="icImage" src="../../static/img/time.png.png" mode=""></image></view>
						<view>{{item._add_time}}</view>
					</view>
					<view class="right">
						<view >
							<view class="status"> {{item._status}}</view>
								<view class="statusColor">
									{{ item.en}}
								</view>
						</view>
					
			
					</view>
				</view>
				<view class="list-name">
					<view>
						姓名:<span>{{ item.name}}</span> 
						<!-- <span class='cartPeople'>{{ item.people}}</span> -->
					</view>
					<view class="phone">
						电话:<span>{{ item.mobile}}</span>
					</view>
					<view class="phone">
						<!-- 车牌号:<span>{{ item.cart || }}</span> -->
					</view>
				</view>
			</view>
		</view>
		<!-- button -->
		<view class="footer_button" @click="toCarRepair">
			<view>
				<view class="addTop">
					<image class="addPng" src="../../static/img/add2.png"></image>
					<view class="addName">添加报修</view>
				</view>
				<view class="title">
			      رېمونت قىلىش قوشۇش
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import app from '@/util/api.js'
	export default {
		data() {
			return {
				page:1,
				limit:10,
				finshed:false,
				list:[
					
					
					]
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			godetail(id){
					app.nto('addAgent/addAgent',id)
			},
			toCarRepair(){ 
				app.nto('addAgent/addAgent')
			
			},
			//获得列表
			getlist(){
				app.load()
				let data = {
					page:this.page,
					limit:this.limit,
				}
				app.request('train_list',data).then(res=>{
					if(this.page == 1){
						this.list = []
					}
					this.list = this.list.concat(res.data.list)
					if(res.data.list.length<this.limit){
						this.finshed = true
					}
					app.hide()
				})
			},
			
		},
		onReachBottom() {
			if(!this.finshed){
				this.page++
				this.getlist()
			}
		}
	}
</script>

<style scoped>
	.content{
		min-height: 100vh;
		background: #F5F5F5;
		font-family: PingFang SC;
		padding-bottom: 110rpx;
	}
	.content-hender{ 
		padding: 20rpx;
	}
	.content-list{ 
		background: #FFFFFF;
		padding: 0rpx 28rpx 20rpx 24rpx;
		margin-top: 20rpx;
	}
	.cartPeople{ 
		padding: 3rpx 8rpx;
		background: #FFFFFF;
		border: 1rpx solid #FFC03C;
		border-radius: 2rpx;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFC03C;
	}
	.list-header{ 
		border-bottom: 1px solid #F5F5F5;
		padding: 18rpx 0;
	} 
	.left{ 
		display: flex;
		justify-content: flex-start;
		align-items: center;
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
	}
	.left .icImage{ 
		display: block;
		width: 20rpx;
		height: 20rpx;
		margin-right: 10rpx;
	} 
	.list-header{ 
		display: flex;
		justify-content: space-between;
	}
	.right{
		display: flex;
		flex-direction: column;
	}
	.status{ 
		font-size: 24rpx;
		font-weight: 500;
		color: #FFC03C;
		text-align: right;
	}
	.statusColor{ 
		font-size: 20rpx;
		font-weight: 500;
		color: #FFC03C;
		margin-top: 10rpx;
	}
	.list-name{ 
		font-size: 30rpx;
		font-weight: 500;
		color: #333333;
		padding-top: 29rpx;
	}
	.list-name span{ 
		margin-left: 20rpx;
	}
	.phone{
		margin-top: 30rpx;
	}
	.refuse{ 
		display: flex;
		justify-content: flex-end;
		align-items: center;
		font-size: 24rpx;
		font-weight: 500;
		color: #FF3C3C;
	}
	.refuse .activeImage{
		display: block;
		width: 24rpx;
		height: 24rpx;
		margin-left: 10rpx;
	} 
	.footer_button{ 
		width: 100%;
		padding: 23rpx 0 15rpx 0;
		background: #FFC03C;
		display: flex;
		justify-content: center;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 122;
	}
	.footer_button .addPng{ 
		display: block;
		width: 26rpx;
		height: 26rpx;
		margin-right: 15rpx;
	}
	.addTop{ 
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.addName{ 
		font-size: 30rpx;
		font-weight: 500;
		color: #FFFFFF;
	}
	.title{ 
		font-size: 24rpx;
		font-weight: 400;
		color: #FFFFFF;
	}
</style>